package work.MrSun.xyq.controller;

/**
 * @Author MrSun
 * @Date 2023/4/30 15:46
 */

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import work.MrSun.xyq.model.XyqCommentReply;
import work.MrSun.xyq.service.XyqAttendService;
import work.MrSun.xyq.service.XyqCommentReplayService;
import work.MrSun.xyq.service.XyqNewMessageService;
import work.MrSun.xyq.service.XyqUserService;
import work.MrSun.xyq.util.isCommentReply.IsCommentReply;

/**
 * 增加评论回复
 */
@RestController
public class CommentReplyController {
    @Autowired
    private XyqUserService xyqUserService;
    @Autowired
    private XyqCommentReplayService xyqCommentReplayService;
    @Autowired
    private XyqNewMessageService xyqNewMessageService;
    @Autowired
    private XyqAttendService xyqAttendService;

    @Transactional
    @PostMapping("/addCommentReply/{messageId}")
    public IsCommentReply addCommentReply(@PathVariable Integer messageId,
                                          @RequestBody XyqCommentReply xyqCommentReply) {
        return new IsCommentReply().isTrue(messageId,xyqCommentReply,
                xyqUserService,xyqCommentReplayService,
                xyqNewMessageService,xyqAttendService);

    }
}
